luci-mod-system: enforce availability of english as language choice
authorJo-Philipp Wich <[email protected]>
Wed, 27 Apr 2022 18:54:58 +0000 (20:54 +0200)
committerJo-Philipp Wich <[email protected]>
Fri, 20 May 2022 18:23:26 +0000 (20:23 +0200)
Always offer english, regardless of whether a dummy language pack for it
is installed or not.

Fixes: #5783
Signed-off-by: Jo-Philipp Wich <[email protected]>
(cherry picked from commit c2eb30bba7451d16e1de37411624b2bcc449c037)

modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js

index aef11b2bc0b2e3ac46e3c1b11360c128850310a9..767bc8c619fb14f756ccbcf56bb617e99ca8827d 100644 (file)
@@ -228,10 +228,11 @@ return view.extend({
                o.ucioption = 'lang';
                o.value('auto');
 
-               var k = Object.keys(uci.get('luci', 'languages') || {}).sort();
+               var l = Object.assign({ en: 'English' }, uci.get('luci', 'languages')),
+                   k = Object.keys(l).sort();
                for (var i = 0; i < k.length; i++)
                        if (k[i].charAt(0) != '.')
-                               o.value(k[i], uci.get('luci', 'languages', k[i]));
+                               o.value(k[i], l[k[i]]);
 
                o = s.taboption('language', form.ListValue, '_mediaurlbase', _('Design'))
                o.uciconfig = 'luci';